package com.example.moshudriver.activity;

import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.BeeFramework.model.BusinessResponse;
import com.sgr.dykdriver.R;
import com.example.moshudriver.model.UserModel;
import com.example.moshudriver.protocol.ApiInterface;
import com.external.androidquery.callback.AjaxStatus;

public class B3_DeclareActivity extends Activity implements BusinessResponse {

	private TextView tv_declare;
	private UserModel userModel;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.b3_declare);
		ImageView top_view_back = (ImageView) findViewById(R.id.top_view_back);
		top_view_back.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
		TextView top_view_title = (TextView) findViewById(R.id.top_view_title);
		top_view_title.setText("免责声明");
		tv_declare = (TextView) findViewById(R.id.tv_declare);
		userModel = new UserModel(this);
		userModel.addResponseListener(this);
		userModel.Declare();
		
	}

	@Override
	public void OnMessageResponse(String url, JSONObject jo, AjaxStatus status)
			throws JSONException {
		// TODO Auto-generated method stub
		if (url.endsWith(ApiInterface.COMMENT_DISCLAIMER)) {
			
			tv_declare.setText(userModel.mContent);
		}
		
	}
}
